﻿using System;
using Pixysoft.Framework.XSchEmA.Entity;

namespace Pixysoft.Framework.XSchEmA
{
    /// <summary>
    /// 验证输入是否正确
    /// </summary>
    public interface IDbVerifier
    {
        string Message { get; }
        bool VerifyColumnName(string input, DatabaseSchema database, TableSchema table);
        bool VerifyColumnRename(string input, DatabaseSchema database, TableSchema table, ColumnSchema column);
        bool VerifyCreatePrimaryKey(System.Collections.Generic.List<ColumnSchema> columns, DatabaseSchema database, TableSchema table);
        bool VerifyCreateUnique(DatabaseSchema database, string constraintName, TableSchema table, System.Collections.Generic.List<ColumnSchema> columns);
        bool VerifyDatatype(DataTypeSchema input, DatabaseSchema database, TableSchema table, ColumnSchema column);
        bool VerifyDefaultValue(string value, ColumnSchema column);
        bool VerifyDeletePrimaryKey(DatabaseSchema database, PrimaryKeySchema pk);
        bool VerifyDeleteUnique(DatabaseSchema database, UniqueSchema unique);
        bool VerifyFkIndexName(string input, DatabaseSchema database, TableSchema fTable, System.Collections.Generic.List<ColumnSchema> fColumns);
        bool VerifyFkName(string input, DatabaseSchema database);
        bool VerifyIndexName(string input, DatabaseSchema database);
        bool VerifyIsNullable(bool input, DatabaseSchema database, TableSchema table, ColumnSchema column);
        bool VerifyPkName(string input, DatabaseSchema database);
        bool VerifyTableName(string input, DatabaseSchema database);
    }
}
